import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [
  // { path: '/', redirect: "/login" },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/login')
  },
  {
    path: '/',
    name: '',
    component: () => import('@/views/layout/layout'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home/home')
      },
      {
        path: '/qa',
        name: 'qa',
        component: () => import('@/views/qa/qa')
      },
      {
        path: '/video',
        name: 'video',
        component: () => import('@/views/video/video')
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('@/views/my/my')
      }
    ]
  },
  { path: '/search', component: () => import('@/views/search/search') },
  { path: '/userAlter', component: () => import('@/views/userAlter/userAlter') },
  { path: '/article/:articleId', component: () => import('@/views/article/article') },
  { path: '/chat', component: () => import('@/views/chat/chat') },

]

const router = new VueRouter({
  routes,
  mode: "history"
})

export default router
